const BasicModel = require('./BasicModel');

module.exports = class extends BasicModel {
  async loginAction(params) {
    // console.log('model: user/user/login');
    const data = this.model(params.model).where({num: params.data.num}).find();
    return data;
  }
  async resetAction(params) {
    this.model(params.model).where({id: params.resetdata.stu_id}).update({password: '88888888'});
  }
  async editstateAction(params) {
    const data = this.model(params.model).where({id: params.data.id}).update(params.data);
    return data;
  }
  async addAction(params) {
    const id = think.uuid('v4');
    params.data.id = id;
    const data = this.model(params.model).add(params.data);
    return data;
  }
};
